//
//  LYQDemandManageHeaderCell.m
//  ZCProject
//
//  Created by Zheng on 2016/12/20.
//  Copyright © 2016年 Zheng. All rights reserved.
//

#import "LYQDemandManageHeaderCell.h"

@implementation LYQDemandManageHeaderCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        [self.contentView addSubview:self.tpyeImgv];
        [self.contentView addSubview:self.titleLbl];
        
        [self layoutSubviewsInContentView];
    }
    return self;
}

#pragma mark - layout subivews
- (void)layoutSubviewsInContentView {
    
    [_tpyeImgv mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(kWScale(10));
        make.top.mas_equalTo(kWScale(12));
        make.bottom.mas_equalTo(-kWScale(12));
        make.width.equalTo(@(kWScale(46)));
        make.height.equalTo(@(kWScale(23)));
    }];
    
    [_titleLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_tpyeImgv.mas_right).offset(kWScale(17));
        make.right.equalTo(self).offset(-kWScale(10));
        make.centerY.equalTo(_tpyeImgv);
    }];
    
}

#pragma mark - lazy load subviews
- (UIImageView *)tpyeImgv {
    if (_tpyeImgv) {
        return _tpyeImgv;
    }
    
    _tpyeImgv = [[UIImageView alloc] init];
    _tpyeImgv.image = [UIImage imageNamed:@"caigoubg"];
    
    return _tpyeImgv;
}

- (UILabel *)titleLbl {
    if (_titleLbl) {
        return _titleLbl;
    }
    
    _titleLbl = [[UILabel alloc] init];
    _titleLbl.font = kWFont(16);
    _titleLbl.textColor = kLYQBlack;
    
    return _titleLbl;
}

@end
